package net.googlecode.harchenko.task3;

import java.math.BigDecimal;

/**
 * Created by IntelliJ IDEA.
 * User: dima
 * Date: 3/25/11
 * Time: 8:33 PM
 * To change this template use File | Settings | File Templates.
 */

/**
 * Class, that realize Manager.
 */
public class Manager extends Person {

    /**
     * Is salary counts per hour or not.
     */
    private boolean perHour;

    /**
     * Constructor of class Manager.
     *
     * @param firstName Firstname of the person.
     * @param lastName  Lastname of the person.
     * @param age       Age of the person.
     * @param rate      Rate of the person.
     * @param perHour   Is person's salary counts per hour.
     * @param bonusAmt  Bonus amount of the person.
     */
    public Manager(final String firstName, final String lastName, final int age,
                   final BigDecimal rate, final boolean perHour, final BigDecimal bonusAmt) {
        super(firstName, lastName, age, rate, bonusAmt);
        this.perHour = perHour;
    }

    /**
     * @return Is salary of the person counts per hour or not.
     */
    public boolean isPerHour() {
        return perHour;
    }

    /**
     * Sets is salary of the person counts per hour or not.
     *
     * @param perHour Is salary of the person counts per hour or not
     */
    public void setPerHour(boolean perHour) {
        this.perHour = perHour;
    }

    /**
     * Override method for comfortable output.
     *
     * @return Comfortable presentation of object of the class.
     */
    public String toString() {
        return "Manager >> " + getLastName() + " " + getFirstName()
                + ",age:" + getAge();
    }

}
